<template>
  <PageWrapper dense>
    <CollapseContainer title="基本信息">
      <Description :column="2" :bordered="false" :data="productInfo" :schema="schema" />
    </CollapseContainer>
  </PageWrapper>
</template>

<script setup lang="ts">
import { toRefs } from 'vue';
import { CollapseContainer } from '@/components/Container';
import { PageWrapper } from '@/components/Page';
import { DictEnum } from '@/enums/dictEnum';
import { Description, DescItem } from '@/components/Description/index';
import { useRender } from '@/hooks/component/useRender';
defineOptions({ name: 'Price' });
const { renderDict, renderRate } = useRender();
const props = defineProps({
  productInfo: {
    type: Object,
    default: () => ({}),
  },
});
const { productInfo } = toRefs(props);
const schema: DescItem[] = [
  {
    field: 'spuName',
    label: '产品名称',
  },
  {
    field: 'spuTypeId',
    label: '分组',
    render: (curVal) => {
      return renderDict(curVal, DictEnum.SPU_TYPE);
    },
  },
  {
    field: 'spuNo',
    label: '产品编号',
  },
  {
    field: 'topicId',
    label: '主题',
    render: (curVal) => {
      return renderDict(curVal, DictEnum.SPU_TOPIC);
    },
  },
  {
    field: 'productCompanyTelephone',
    label: '产品图片',
    span: 2
  },
  {
    field: 'spuDesc',
    label: '概述',
    span: 2
  },
  {
    field: 'spuDetail',
    label: '产品描述',
    span: 2
  },
  {
    field: 'spuKeyWord',
    label: '关键字',
  },
  {
    field: 'spuColor',
    label: '颜色',
    render: (curVal) => {
      return renderDict(curVal, DictEnum.SPU_COLOR);
    },
  },
  {
    field: 'spuMaterial',
    label: '材质',
    render: (curVal) => {
      return renderDict(curVal, DictEnum.SPU_MATERIAL);
    },
  },
  {
    field: 'spuSize',
    label: '产品尺寸',
  },
  {
    field: 'spuWeight',
    label: '产品重量',
  },
  {
    field: 'spuMadeIn',
    label: '产地',
    render: (curVal) => {
      return renderDict(curVal, DictEnum.COUNTRY);
    },
  },
];
</script>
